#ifndef __OBJMODEL_LOADER_H__
#define __OBJMODEL_LOADER_H__

#include "IModelLoader.h"
#include "Mesh.h"
#include "Material.h"

namespace steam
{
	namespace coal
	{
		class OBJModelLoader : public IModelLoader
		{
		public:

			IMesh* load( std::string filePath );

		private:

			enum FaceDataType
			{
				FACE_NOT_SUPPORTED = 0,
				TRIANGLE_WITH_NO_UV_NO_NORM,
				TRIANGLE_WITH_UV_NO_NORM,
				TRIANGLE_WITH_NORM_NO_UV,
				TRIANGLE_WITH_UV_NORM,
				QUAD_WITH_NO_UV_NO_NORM,
				QUAD_WITH_UV_NO_NORM,
				QUAD_WITH_NORM_NO_UV,
				QUAD_WITH_UV_NORM		
			};

			void extractMaterials(std::vector<std::string>& lines, Mesh* mesh, std::string filePath);

			void processMaterials(Mesh* mesh, std::string fileName, std::string filePath);

			bool startsWith(std::string starter, std::string text);

			FaceDataType getMeshType(std::string str);

		};
	}

}

#endif